package com.park.common.poo;

import com.park.common.constant.IDBConstant;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Created by Administrator on 2017-05-01.
 */
@Entity
@Table(name = "article_info", schema = "", catalog = "totem")
public class ArticleInfo {
    private Integer articleId;
    private String articleTitle;
    private String articlePic;
    private String articleBody;
    private String articleStatus;
    private Integer articleSeq;
    private String serviceType = IDBConstant.LOGIC_STATUS_YES;
    private String createTime;
    private String updateTime;
    private String articleAbstract;

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "articleId")
    public Integer getArticleId() {
        return articleId;
    }

    public void setArticleId(Integer articleId) {
        this.articleId = articleId;
    }

    @Basic
    @Column(name = "articleTitle")
    public String getArticleTitle() {
        return articleTitle;
    }

    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }

    @Basic
    @Column(name = "articlePic")
    public String getArticlePic() {
        return articlePic;
    }

    public void setArticlePic(String articlePic) {
        this.articlePic = articlePic;
    }

    @Basic
    @Column(name = "articleBody")
    public String getArticleBody() {
        return articleBody;
    }

    public void setArticleBody(String articleBody) {
        this.articleBody = articleBody;
    }

    @Basic
    @Column(name = "articleStatus")
    public String getArticleStatus() {
        return articleStatus;
    }

    public void setArticleStatus(String articleStatus) {
        this.articleStatus = articleStatus;
    }

    @Basic
    @Column(name = "articleSeq")
    public Integer getArticleSeq() {
        return articleSeq;
    }

    public void setArticleSeq(Integer articleSeq) {
        this.articleSeq = articleSeq;
    }

    @Basic
    @Column(name = "serviceType")
    public String getServiceType() {
        return serviceType;
    }

    public void setServiceType(String serviceType) {
        this.serviceType = serviceType;
    }

    @Basic
    @Column(name = "createTime")
    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "updateTime")
    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ArticleInfo that = (ArticleInfo) o;

        if (articleId != that.articleId) return false;
        if (articleTitle != null ? !articleTitle.equals(that.articleTitle) : that.articleTitle != null) return false;
        if (articlePic != null ? !articlePic.equals(that.articlePic) : that.articlePic != null) return false;
        if (articleBody != null ? !articleBody.equals(that.articleBody) : that.articleBody != null) return false;
        if (articleStatus != null ? !articleStatus.equals(that.articleStatus) : that.articleStatus != null)
            return false;
        if (articleSeq != null ? !articleSeq.equals(that.articleSeq) : that.articleSeq != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = articleId;
        result = 31 * result + (articleTitle != null ? articleTitle.hashCode() : 0);
        result = 31 * result + (articlePic != null ? articlePic.hashCode() : 0);
        result = 31 * result + (articleBody != null ? articleBody.hashCode() : 0);
        result = 31 * result + (articleStatus != null ? articleStatus.hashCode() : 0);
        result = 31 * result + (articleSeq != null ? articleSeq.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "articleAbstract")
    public String getArticleAbstract() {
        return articleAbstract;
    }

    public void setArticleAbstract(String articleAbstract) {
        this.articleAbstract = articleAbstract;
    }
}
